<?php

namespace App\Transformers\SystemNotice;

use App\Models\SystemNoticeAdmin;
use League\Fractal\TransformerAbstract;

class SystemNoticeAdminTransformer extends TransformerAbstract
{
    public function transform(SystemNoticeAdmin $data){
        return [
            'id' => $data->id,
            'link_id' => $data->link_id ?? '',
            'admin_id' => $data->admin_id ?? '',
            'notice_type' => $data->notice_type ?? '',
            'table_data' => $data->table_data ?? '',
            'click' => $data->click ?? '',
            'visit' => $data->visit ?? '',
            'visit_time' => $data->visit_time ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }

}
